<?php
namespace app\index\controller;

use auth\Auth;
use think\config;
use think\Session;
use think\Controller;
 
class Base extends Controller{
	

     public function _initialize()
    {
		//判断用户是否登录
		$isLogin=$this->isLogin();
		if(!$isLogin){
			return $this->redirect('Login/index');
		}

	}

    //判定是否登录
	public function isLogin(){
		//获取session
		$user=Session::has('gname');
		if($user ){
			return true;
		}
		return false;
	}
 
}
